package cn.iocoder.yudao.module.biz.dal.mysql.expand.powerAccount;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.dal.dataobject.expand.powerAccount.ExpandTargetPowerAccountDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.expand.powerAccount.vo.*;

/**
 * 拓展目标_客户_用电户号 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface ExpandTargetPowerAccountMapper extends BaseMapperX<ExpandTargetPowerAccountDO> {

    default PageResult<ExpandTargetPowerAccountDO> selectPage(ExpandTargetPowerAccountPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ExpandTargetPowerAccountDO>()
                .eqIfPresent(ExpandTargetPowerAccountDO::getAccount, reqVO.getAccount())
                .likeIfPresent(ExpandTargetPowerAccountDO::getName, reqVO.getName())
                .eqIfPresent(ExpandTargetPowerAccountDO::getPowerType, reqVO.getPowerType())
                .eqIfPresent(ExpandTargetPowerAccountDO::getVoltageLevel, reqVO.getVoltageLevel())
                .eqIfPresent(ExpandTargetPowerAccountDO::getCountMode, reqVO.getCountMode())
                .eqIfPresent(ExpandTargetPowerAccountDO::getPowerTimes, reqVO.getPowerTimes())
                .eqIfPresent(ExpandTargetPowerAccountDO::getCustomerType, reqVO.getCustomerType())
                .eqIfPresent(ExpandTargetPowerAccountDO::getTransformerAmount, reqVO.getTransformerAmount())
                .eqIfPresent(ExpandTargetPowerAccountDO::getTransformerVolume, reqVO.getTransformerVolume())
                .eqIfPresent(ExpandTargetPowerAccountDO::getWorkingYears, reqVO.getWorkingYears())
                .eqIfPresent(ExpandTargetPowerAccountDO::getMaintenanceMode, reqVO.getMaintenanceMode())
                .eqIfPresent(ExpandTargetPowerAccountDO::getIsBreakdown, reqVO.getIsBreakdown())
                .eqIfPresent(ExpandTargetPowerAccountDO::getCustomerId, reqVO.getCustomerId())
                .betweenIfPresent(ExpandTargetPowerAccountDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ExpandTargetPowerAccountDO::getOwnerUserId, reqVO.getOwnerUserId())
                .orderByDesc(ExpandTargetPowerAccountDO::getId));
    }

}